//
//  StoreCommissionBrokerCell.m
//  WGFGlobalHouses
//
//  Created by waiguofang on 15/6/9.
//  Copyright (c) 2015年 waiguofang. All rights reserved.
//

#import "StoreCommissionBrokerCell.h"
#import "StoreCommissionBroker.h"
#import "config.h"
#import "UIImageView+WebCache.h"
#import "StringTool.h"



@interface StoreCommissionBrokerCell ()

@property (weak, nonatomic) IBOutlet UILabel *priceLab;
@property (weak, nonatomic) IBOutlet UILabel *nameLab;
@property (weak, nonatomic) IBOutlet UILabel *phoneLab;
@property (weak, nonatomic) IBOutlet UIImageView *headImgView;
@property (weak, nonatomic) IBOutlet UILabel *companyLab;

@end

@implementation StoreCommissionBrokerCell




+(instancetype)cellWithTableView:(UITableView *)tableview{

    static NSString *ID = @"StoreCommissionBrokerCell";
    StoreCommissionBrokerCell *cell = [tableview dequeueReusableCellWithIdentifier:ID];
    if (cell == nil)
    {
        cell = [[[NSBundle mainBundle]loadNibNamed:@"StoreCommissionBrokerCell" owner:nil options:nil]lastObject];
        
        UIView *seView = [[UIView alloc]init];
        [seView setBackgroundColor:UIColorFromRGB(0xf7f7f7)];
        [cell setSelectedBackgroundView:seView];
    }
    
    return cell;
}


+(CGFloat)getHight:(CellBaseData*)data withTableView:(UITableView*)tableView{
    return 70;
}


-(void)setData:(StoreCommissionBroker*)data{
    
    [self.nameLab setText:data.name];
    [self.priceLab setText:data.saleCount];
    [self.phoneLab setText:data.mobile];
    [self.headImgView sd_setImageWithURL:[NSURL URLWithString:data.imgUrL] placeholderImage:[UIImage imageNamed:@"headtop_pic"]];
    
    if ([StringTool isBlankString:data.company]) {
        [self.companyLab setHidden:YES];
    }else{
        [self.companyLab setHidden:false];
        [self.companyLab setText:data.company];
    }
}

@end
